import {todoListType} from "@/types/todoList";

//存储todoList数据到浏览器本地存储
export function saveTodoList(todoList:todoListType){
    localStorage.setItem('todoList', JSON.stringify(todoList))
}

//通过浏览器本地存储获取todoList数据
export function getTodoList(){
    //断言 localStorage.getItem('todoList' ) 一定是一个字符串
   return JSON.parse(localStorage.getItem('todoList' ) as string) || '[]'
}
